<%@LANGUAGE="VBSCRIPT"%>
 <!--#include file="functions.asp" -->
<%
'if (request("refOrder") ="Y") then
tmpurl= "Inv_Detail.asp?seqnum=" & Request.QueryString("Seqnum")
'else
'tmpurl = "Inv_Reg_WRO.asp"
'end if

Dim EXIREG__tmpNum
EXIREG__tmpNum = "0"
if (Request.QueryString("Seqnum") <> "") then EXIREG__tmpNum = Request.QueryString("Seqnum")
%>
<%
set EXIREG = Server.CreateObject("ADODB.Recordset")
EXIREG.ActiveConnection = cn
EXIREG.Source = "SELECT SEQNUM, REGNUM, INVNUM, VENDORID, INVRECDATE, INVDUEDATE, EMPCODE, DEPARTMENT, INVCURRENCY, (SELECT EXCHANGERATE FROM EXCHRATE WHERE EXCHRATE.MP2CURRENCY=EXIREG.INVCURRENCY) AS FRATE, CURRENCYSYMBOL, INVAMOUNT, TOTALSHIPPINGCHARGE, MISCCHARGE, REFORDER, COMPCODE, VATNUM, WHTNAME, VATRATE, WHTRATE, WHTAMOUNT, VATPAIDTOVENDOR, DOC1, DOC2,  (SELECT DISTINCT VENDOR.NAME  FROM VENDOR  WHERE VENDOR.VENDORID=EXIREG.VENDORID) AS VENDORNAME,    (SELECT EMP.FIRSTNAME + ' '  + EMP.LASTNAME FROM dbo.EMP WHERE EXIREG.EMPCODE=EMP.EMPCODE) AS EMPNAME,  NOTES  FROM dbo.EXIREG  WHERE SEQNUM=" + Replace(EXIREG__tmpNum, "'", "''") + ""
'EXIREG.CursorType = 0
'EXIREG.CursorLocation = 2
'EXIREG.LockType = 3
EXIREG.Open()
EXIREG_numRows = 0
%>
<% 
'Response.Clear
'Response.ContentType = "application/vnd.ms-excel"
'Response.BinaryWrite poRsFromBll("mFtsSf135")
'Response.Flush
%>

<html>
<head>
<title>Invoice Receipt</title>
<link rel="stylesheet" href="CAR_style.css" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<table width="100%" border="0" cellspacing="2" cellpadding="3" bgcolor="#FFFFFF">
  <tr> 
    <td colspan="3" bgcolor="#FFFFFF"><b><font size="2">Service Acceptance Note</font></b></td>
    <td bgcolor="#FFFFFF" width="15%">&nbsp;</td>
    <td bgcolor="#FFFFFF">&nbsp;</td>
    <td bgcolor="#FFFFFF"> 
      <div align="right"><img src="images/Logo_premier2.jpg" width="164" height="40"></div>
    </td>
  </tr>
  <tr> 
    <td colspan="6" bgcolor="#FFFFFF">&nbsp; </td>
  </tr>
</table>
<table width="100%" align="center" class="myTable">
  <tr> 
    <td width="34%" bgcolor="#FFFFFF">&nbsp;</td>
    <td width="2%">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Service Acceptance No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30"> <%=(EXIREG.Fields.Item("REGNUM").Value)%> </td>
    <td width="20%" height="30" valign="middle"><img src="images/kotak.gif" width="22" height="22"><b><font size="2">&nbsp;&nbsp;Scanning </font></b></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor ID:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30"> <%=(EXIREG.Fields.Item("VENDORID").Value)%> </td>
    <td width="20%" height="30"><img src="images/kotak.gif" width="22" height="22"><b><font size="2">&nbsp;&nbsp;Routing</font></b></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Name:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30"> <%=(EXIREG.Fields.Item("VENDORNAME").Value)%> </td>
    <td width="20%" height="30"><img src="images/kotak.gif" width="22" height="22"><b><font size="2">&nbsp;&nbsp;Issued</font></b></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Vendor Invoice No.:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Currency:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Total Amount:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %> </td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Received Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%= year(EXIREG.Fields.Item("INVRECDATE").Value)%>-<%= (string(2-len(month(EXIREG.Fields.Item("INVRECDATE").Value)),"0")&month(EXIREG.Fields.Item("INVRECDATE").Value)) %>-<%=(string(2-len(day(EXIREG.Fields.Item("INVRECDATE").Value)),"0")&day(EXIREG.Fields.Item("INVRECDATE").Value))%> </td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Invoice Received By:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%=(EXIREG.Fields.Item("EMPNAME").Value)%></td>
  </tr>
  <tr> 
    <td width="34%" bgcolor="#FFFFFF" height="30"> 
      <div align="right"><i>Estimate Latest Payment Date:</i></div>
    </td>
    <td width="2%" height="30">&nbsp;</td>
    <td height="30" colspan="2"><%= year(EXIREG.Fields.Item("INVDUEDATE").Value)%>-<%= (string(2-len(month(EXIREG.Fields.Item("INVDUEDATE").Value)),"0")&month(EXIREG.Fields.Item("INVDUEDATE").Value)) %>-<%=(string(2-len(day(EXIREG.Fields.Item("INVDUEDATE").Value)),"0")&day(EXIREG.Fields.Item("INVDUEDATE").Value))%></td>
  </tr>
</table>

<table width="100%" class="myTable">
  <tr valign="middle"> 
    <td width="48%" bgcolor="#FFFFFF" height="63"> 
      <div align="center">Computer generated.<br>
        No sign or stamp is required.</div>
    </td>
    <td width="2%" height="63"> 
      <div align="center"><img src="images/spacer_black.gif" width="1" height="100%"></div>
    </td>
    <td height="63">This invoice receipt note shall be printed in 2 copies.<br>
      &gt; 1 copy is required for invoice data capture &amp; cataloguing<br>
      &gt; 1 copy will be given to vendor as a receipt note.</td>
  </tr>
  
</table><br><br>
<div align="center"> <img src="images/spacer_black.gif" width="100%" height="1"></div>
<br><br>
  <table width="100%" border="0" cellspacing="2" cellpadding="3" bgcolor="#FFFFFF">
    <tr> 
      <td colspan="3" bgcolor="#FFFFFF"><b><font size="2">Service Acceptance Note</font></b></td>
      <td bgcolor="#FFFFFF" width="15%">&nbsp;</td>
      <td bgcolor="#FFFFFF">&nbsp;</td>
      <td bgcolor="#FFFFFF"> 
        
      <div align="right"><img src="images/Logo_premier2.jpg" width="164" height="40"></div>
      </td>
    </tr>
    <tr> 
      <td colspan="6" bgcolor="#FFFFFF">&nbsp; </td>
    </tr>
  </table>
  <table width="100%" align="center" class="myTable">
    <tr> 
      <td width="35%" bgcolor="#FFFFFF">&nbsp;</td>
      <td width="2%">&nbsp;</td>
      <td width="0">&nbsp;</td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Service Acceptance No.:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"> <%=(EXIREG.Fields.Item("REGNUM").Value)%> </td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Vendor ID:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORID").Value)%> </td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Vendor Name:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"> <%=(EXIREG.Fields.Item("VENDORNAME").Value)%> </td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Vendor Invoice No.:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%=(EXIREG.Fields.Item("INVNUM").Value)%></td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Currency:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%=(EXIREG.Fields.Item("CURRENCYSYMBOL").Value)%></td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Invoice Total Amount:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%= FormatNumber((EXIREG.Fields.Item("INVAMOUNT").Value), -1, -2, -2, -1) %> </td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Received Date:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%= year(EXIREG.Fields.Item("INVRECDATE").Value)%>-<%= (string(2-len(month(EXIREG.Fields.Item("INVRECDATE").Value)),"0")&month(EXIREG.Fields.Item("INVRECDATE").Value)) %>-<%=(string(2-len(day(EXIREG.Fields.Item("INVRECDATE").Value)),"0")&day(EXIREG.Fields.Item("INVRECDATE").Value))%> </td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Invoice Received By:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%=(EXIREG.Fields.Item("EMPNAME").Value)%></td>
    </tr>
    <tr> 
      <td width="35%" bgcolor="#FFFFFF" height="30"> 
        <div align="right"><i>Estimate Latest Payment Date:</i></div>
      </td>
      <td width="2%" height="30">&nbsp;</td>
      <td width="0" height="30"><%= year(EXIREG.Fields.Item("INVDUEDATE").Value)%>-<%= (string(2-len(month(EXIREG.Fields.Item("INVDUEDATE").Value)),"0")&month(EXIREG.Fields.Item("INVDUEDATE").Value)) %>-<%=(string(2-len(day(EXIREG.Fields.Item("INVDUEDATE").Value)),"0")&day(EXIREG.Fields.Item("INVDUEDATE").Value))%></td>
    </tr>
  </table>
  <table width="100%" class="myTable">
    <tr valign="middle"> 
      <td width="48%" bgcolor="#FFFFFF" height="63"> 
        <div align="center">Computer generated.<br>
          No sign or stamp is required.</div>
      </td>
      <td width="2%" height="63"> 
        <div align="center"><img src="images/spacer_black.gif" width="1" height="100%"></div>
      </td>
      <td height="63">This invoice receipt note shall be printed in 2 copies.<br>
        &gt; 1 copy is required for invoice data capture &amp; cataloguing<br>
        &gt; 1 copy will be given to vendor as a receipt note.</td>
    </tr>
   
  </table>
  
<p align="center"> 
  <input type="submit" name="Submit" value="Print Receipt" onClick="window.print();window.location='<%= tmpurl %>';" class="hiddenBtn">
</p>
</body>
</html>
<%
EXIREG.Close()
%>
<SCRIPT language="JavaScript">
//window.print();
//window.location='<%= tmpurl %>';
</SCRIPT>
